<template>
  <div class="container">
    <!-- 面包屑导航 -->
    <breadcrumb :breadcrumbConfig=breadcrumbConfig></breadcrumb>
    <!--    <breadcrumb></breadcrumb>-->
    <!-- 面包屑导航 -->
    <div class="content page-title">
      <h2>售后记录</h2>
    </div>
    <div class="content">
      <h3>列表数据<!--<el-button plain @click="showDialog('批量审核', '640px', 'afterSaleShenhe', multipleSelection, true)">批量审核</el-button>--></h3>
      <orders-list-table v-loading="loading" :dataList="page.list" :heightStr='columns.height' :parArrayArr ='parArray'  :config="columns.config" :typeStr='columns.type'
      @tableSelectionChange="handleSelectionChange"
      @onTableShowDialogCom="resTableShowDialog"
      @onRevocationAfterSales = 'cancelAfterSales'
      @onConfirmTakeChange = 'onConfirmReceipt'
      >
      </orders-list-table>
       <div class="page">
        <el-pagination
            background
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page.sync="page.currentPage"
            :page-sizes="[3, 5, 10, 20, 50]"
            :page-size="page.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="page.totalNum"
        >
        </el-pagination>
      </div>
      <!-- <lb-table
          :column="columns"
          :data="page.list"
          pagination
          align="center"
          :total="page.totalNum"
          layout="total, sizes, prev, pager, next, jumper"
          :page-sizes="[5, 10, 20, 30, 50]"
          :current-page.sync="page.currentPage"
          :page-size="page.pageSize"
          @size-change="handleSizeChange"
          @p-current-change="handleCurrentChange"
          @selection-change="handleSelectionChange"
      >
      </lb-table> -->
    </div>
    <!--========================== el-dialog =================================-->
    <el-dialog
        :title="dialog.title"
        :visible.sync="dialog.visible"
        :width="dialog.width"
        :append-to-body="true"
    >
      <!-- 审核 -->
      <template v-if="dialog.type === 'afterSaleShenhe'">
        <audit-operation ref="afterSaleShenhe" :orderObj="dialog.row" :afterNos="multipleSelection" @submitState="shenheState"></audit-operation>
      </template>

      <!-- 取消售后 撤回售后 -->
      <template v-if="dialog.type === 'cancelService'">
        <div class="cancellation-reason">
        <h3>是否撤回售后申请？撤回后会取消审核。</h3>
        <div class="cancellation-left">取消原因</div>
          <div class="cancellation-right">
            <el-input
                type="textarea"
                placeholder="请输入取消原因（非必填）"
                v-model="cancellationReason"
                maxlength="200"
                rows="5"
                show-word-limit
            >
            </el-input>
            </div>
        </div>
         <div class="dialogBtnright dialogBtnright_right" style="margin-top:20px">
                  <el-button class="setPay_payment_btn_quxiao" @click="dialog.visible=false">取 消</el-button>
                  <el-button class="setPay_payment_btn_queren" type="primary" @click="handlerCloseOrderSubmit">确 定</el-button>
              </div>
      </template>

      <!-- 退货单号 修改退货单号 修改换货单号 -->
      <template v-if="dialog.type === 'modifyOrderNoOne' || dialog.type === 'modifyOrderNoTwo' || dialog.type === 'modifyOrderNoOneTui'">
        <modify-order-no :orderObj="dialog.row" :type="dialog.type" ref="modifyOrderNo" @submitState="modifyState"></modify-order-no>
      </template>
      <!-- 物流信息 -->
      <template v-if="dialog.type === '2' || dialog.type === 'progress'">
        <step-progress :orderObj="dialog.row" type="2" source="after"></step-progress>
      </template>
      <!-- 进度 -->
      <template v-if="dialog.type === 'shenheStep'">
        <step-progress :orderObj="dialog.row" type="shenheStep" :processFunc="dictionaries.process_func" source="after" ></step-progress>
      </template>
<!--      物流信息、进度，不显示按钮-->
      <div class="dialog-but" v-if="dialog.type !== 'progress'&&dialog.type !== 'cancelService'&&dialog.type !== 'shenheStep'&&dialog.type !== '2'">
        <el-button type="primary" plain @click="closeDialog">取消</el-button>
        <el-button type="primary" @click="actionDialog">确认</el-button>
      </div>
    </el-dialog>
    <!--=========================== el-dialog end================================-->
  </div>

</template>

<script>
import formFiled from '@/components/form/index'
import breadcrumb from '@/components/breadcrumb'
import LbTable from '../../../components/lb-table/lb-table'

import modifyOrderNo from '../components/modifyOrderNo'
import StepProgress from '@/components/StepProgress'
import AuditOperation from '@/components/AuditOperation'
import OrdersListTable from '../components/OrdersListTable'
import mixinsOrderList from '../mixins/mixinsOrderList.js'

import mixinsCommon from '../mixins/common.js'

export default {
  mixins: [mixinsCommon, mixinsOrderList],
  components: {
    formFiled,
    breadcrumb,
    LbTable,
    modifyOrderNo,
    StepProgress,
    AuditOperation,
    OrdersListTable

  },
  data () {
    return {
      loading: false,
      afterNoId: '',
      page: { list: [], pageNo: 1, pageSize: 10, totalNum: 0, currentPage: 1, status: '' },
      multipleSelection: [],
      breadcrumbConfig: {
        list: [
          {
            title: '订单管理',
            type: '#ff0000',
            path: ''
          },
          {
            title: '售后记录',
            type: '1',
            path: ''
          }
        ]
      },
      cancellationReason: '', // 取消原因
      columns: {
        type: 'recordList',
        height: '5000px',
        sortObj: {},
        config: [
          { type: 'selection', width: 50 },
          { prop: 'payTypeLabel', label: '商品名称', width: 150, slot: 'goods' },
          // { prop: 'goodsSkuName', label: '规格', width: 50 },
          // { prop: 'quantity', label: '数量', width: 30 },
          { prop: 'totalAmount', label: '金额', slot: 'totalAmount' },
          { prop: 'orderStatus', label: '订单状态' },
          { prop: 'reason', label: '售后原因' },
          { prop: 'createdUserName', label: '提交信息' },
          { prop: 'approverName', label: '审核信息', slot: 'shenheMessage' },
          { prop: 'rejectReason', label: '不通过原因', slot: 'notGo' },
          { prop: 'afterSaleStep', label: '售后步骤' }
        ]
      }
      // columns: [
      //   { type: 'selection' },
      //   { label: '售后编号', prop: 'afterNo', minWidth: '200', align: 'left' },
      //   { label: '商品名称', align: 'left', minWidth: '250',
      //     render: (h, scope) => {
      //       return (
      //         <div>
      //           <p title={scope.row.goodsName}>{scope.row.goodsName}</p>
      //         </div>
      //       )
      //     }
      //   },
      //   { label: '规格', prop: 'goodsSkuName', minWidth: '120', align: 'left' },
      //   { label: '数量', prop: 'quantity', minWidth: '100' },
      //   {
      //     label: '金额',
      //     align: 'left',
      //     minWidth: '120',
      //     render: (h, scope) => {
      //       return (
      //         <div>
      //           <p>实付：￥{scope.row.totalAmount}</p>
      //           <p>退款：￥{scope.row.refundAmount}</p>
      //         </div>
      //       )
      //     }
      //   },
      //   { label: '订单状态', prop: 'orderStatus', minWidth: '120', align: 'left' },
      //   { label: '售后原因', prop: 'reason', minWidth: '120', align: 'left' },
      //   {
      //     label: '提交信息',
      //     minWidth: '180',
      //     align: 'left',
      //     render: (h, scope) => {
      //       return (
      //         <div>
      //           <p>{scope.row.createdUserName}</p>
      //           <p>{scope.row.createdTime}</p>
      //         </div>
      //       )
      //     }
      //   },
      //   { label: '审核信息', minWidth: '180', align: 'left',
      //     render: (h, scope) => {
      //       return (
      //         <div>
      //           <p>审核人：{scope.row.approverName ? scope.row.approverName : '-'}</p>
      //           <p>{scope.row.approverTime ? scope.row.approverTime : '-'}</p>
      //         </div>
      //       )
      //     } },
      //   { label: '不通过原因', minWidth: '200', align: 'left',
      //     render: (h, scope) => {
      //       return (
      //         <div>
      //           <p>{scope.row.rejectReason ? scope.row.rejectReason : '-'}</p>
      //         </div>
      //       )
      //     } },
      //   { label: '售后步骤', prop: 'afterSaleStep', minWidth: '120', align: 'left' }
      // ]
    }
  },
  created () {
    this.fetchData()
    // this.setListOperation()
    this.getButtonTreeDto('logisticsOrder') // 获取权限设定
    this.getButtonTreeDto('logisticsOrderList') // 获取权限设定
  },
  methods: {
    // 审核，提交状态
    shenheState (state) {
      if (state == true) {
        this.fetchData()
      }
      // 提交后，关闭并还原值
      this.closeDialog()
    },
    // 修改售后物流单号，提交状态
    modifyState (state) {
      if (state == true) {
        this.fetchData()
      }
      // 提交后，关闭并还原值
      this.closeDialog()
    },
    // 接受表单组件的数据
    dialogClick (val, state) {
      this.formFiledDataState = state
      // this.formFiledData = Object.assign(this.formFiledData, val)
      // console.log(this.formFiledData,'接受表单组件的数据');
    },
    fetchData (type, isGoOne) {
      const orderNo = this.$route.query.orderNo
      if (type === 'reset') {
        this.$refs['searchForm'].resetFields()
        this.page.pageNo = 1
        this.page.pageSize = 10
        this.page.currentPage = 1
      }
      let params = {
        pageNo: this.page.pageNo,
        pageSize: this.page.pageSize,
        orderNo
      }
      if (type === 'search') {
        // 如果页码大于 1 列表数据大于 1， 停留在当前页
        if (isGoOne && this.page.pageNo > 1 && this.page.list.length > 1) {
          params.pageNo = this.page.pageNo
        } else { // 正常 跳转到 第一页
          this.page.currentPage = 1
          this.page.pageNo = 1
        }
        const searchForm = this.searchForm
        params = Object.assign(params, searchForm)
        if (searchForm.categoryId) {
          params.categoryId = searchForm.categoryId[searchForm.categoryId.length - 1]
        }
        // 去除字符串 前后 空格
        // for (const item in params) { if (typeof params[item] === 'string') { params[item] = params[item].trim() } }
      }
      this.$api.afterRecordsList(params).then((res) => {
        if (res.code === 0) {
          this.page.list = res.data.list
          // console.log(this.page.list, 'this.page.list')
          this.page.totalNum = res.data.totalNum
          // 操作后就不需要设置操作按钮
          // if (type !== 'operation') { this.setListOperation() }
        } else {
          console.log('goodsPageList - 失败', type)
        }
      }).catch((err) => {
        console.log(err)
      })
    },
    handleCurrentChange (currentChange) {
      this.page.pageNo = currentChange
      this.fetchData()
    },
    handleSizeChange (sizeChange) {
      this.page.currentPage = 1
      this.page.pageSize = sizeChange
      this.fetchData()
    },
    handleSelectionChange (val) {
      this.multipleSelection = val
    },
    // handleSelectionChange (val) {
    //   const userInfo = sessionStorage.getItem('userInfo')
    //   val.forEach(item => {
    //     if (item.createdUserName === userInfo.reallyName) {
    //       return this.$message.warning('不能审核自己的信息')
    //     }
    //   })
    //   this.multipleSelection = val
    // },
    // setListOperation (type, jurisdiction) {
    //   // 权限 显示
    //   // const jurisdiction = "<el-link type='primary' size='mini' type='primary'>jurisdiction</el-link>"
    //   const operation = {
    //     label: '操作',
    //     width: '250',
    //     fixed: 'right',
    //     align: 'center',
    //     render: (h, scope) => {
    //       // 当前登录用户信息
    //       const userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
    //       // 售后步骤：
    //       // 1.审核中（提交售后第一个状态）
    //       // 2.待寄回（退货退款/换货审核通过后，等待客户寄回商品；需录入快递单号）
    //       // 3.退货中（客户已寄回商品）
    //       // 4.待换货（换货订单，仓库已收到寄回商品，审核通过后，等待仓库发货）
    //       // 5.换货中（仓库已发出换货商品）
    //       // 6.售后关闭（售后被撤回）
    //       // 7.商家拒绝售后（审核不通过）
    //       // 8.售后完成（售后步骤完成）

    //       // 权限：
    //       // 1.物流部员工：查看、确认收货（退货退款）、换货寄出、修改换货单号、查询物流情况
    //       // 2.业务员工（根据对应权限操作）：查看、审批、进度、撤回售后、退货单号管理（修改、发货）、确认收货（换货）

    //       const afterSaleStatus = this.dictionaries.after_sale_status
    //       const afterSaleSubsetStatus = this.dictionaries.after_sale_subset_status
    //       // console.log(afterSaleSubsetStatus)
    //       const parArray = this.parArray
    //       // console.log(parArray)
    //       const order_after_pageList = parArray.filter(item => item === 'order_after_pageList') // 售后订单分页列表查询权限赋予  售后订单分页列表查询
    //       const shop_order = parArray.filter(item => item === 'shop_order') // 售后详情页面的需要调用店铺-必选  售后详情页面的需要调用店铺按钮
    //       const platform = parArray.filter(item => item === 'platform') // 售后订单用于调用平台接口-必选  售后订单用于调用平台接口
    //       const xgshwldh = parArray.filter(item => item === 'xgshwldh') // 修改售后物流单号  修改售后物流单号
    //       const chsh = parArray.filter(item => item === 'chsh') // 撤回售后
    //       const plsh = parArray.filter(item => item === 'plsh') // 批量审核
    //       const sqss = parArray.filter(item => item === 'sqss') // 申请售后
    //       const xgshdd = parArray.filter(item => item === 'xgshdd') // 修改售后订单
    //       const orderAfterDetail_getDetailById = parArray.filter(item => item === 'orderAfterDetail_getDetailById') // 售后订单商品信息查询按钮-必选
    //       const orderAfterDetail_getRefundById = parArray.filter(item => item === 'orderAfterDetail_getRefundById') // 售后订单状态信息查询（退款信息）-必选
    //       const main_confirmReceipt_wuliu = parArray.filter(item => item === 'main_confirmReceipt_wuliu') // 确认收货
    //       const getAfterOrderStatusById = parArray.filter(item => item === 'getAfterOrderStatusById') // 售后订单状态信息查询（状态节点）-必选
    //       const order_huanhuojichu = parArray.filter(item => item === 'order_huanhuojichu') // 换货寄出
    //       const after_xghhdh = parArray.filter(item => item === 'after_xghhdh') // 修改换货单号
    //       // Vue中 渲染函数（render）的介绍和应用
    //       // https://cn.vuejs.org/v2/guide/render-function.html#%E6%B7%B1%E5%85%A5%E6%95%B0%E6%8D%AE%E5%AF%B9%E8%B1%A1
    //       const seeDetails = h('el-link', { domProps: { innerHTML: '查看' }, on: { click: () => { this.toOtherPages('afterSaleDetails', scope.row, 'Details') } }, attrs: { type: 'primary', size: 'mini' }})
    //       const afterSaleShenhe = h('el-link', { domProps: { innerHTML: '审核' }, on: { click: () => { this.showDialog('审核', '640px', 'afterSaleShenhe', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const shenheStep = h('el-link', { domProps: { innerHTML: '进度' }, on: { click: () => { this.showDialog('审核流程', '640px', 'shenheStep', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const cancelService = h('el-link', { domProps: { innerHTML: '撤回售后' }, on: { click: () => { this.cancelAfterSales('撤回售后', '640px', 'cancelService', scope.row.afterNo) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const progress = h('el-link', { domProps: { innerHTML: '查看退货物流' }, on: { click: () => { this.showDialog('物流信息-退货', '640px', 'progress', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const modifyOrderNoOne = h('el-link', { domProps: { innerHTML: '修改退货单号' }, on: { click: () => { this.showDialog('修改退货单号', '500px', 'modifyOrderNoOneTui', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const modifyOrderNoTwo = h('el-link', { domProps: { innerHTML: '修改换货单号' }, on: { click: () => { this.showDialog('修改换货单号', '500px', 'modifyOrderNoTwo', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const modifyOrderNoOneTui = h('el-link', { domProps: { innerHTML: '退货单号' }, on: { click: () => { this.showDialog('退货单号', '500px', 'modifyOrderNoOneTui', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const modifyOrderNoTwoHuan = h('el-link', { domProps: { innerHTML: '换货寄出' }, on: { click: () => { this.showDialog('换货寄出', '500px', 'modifyOrderNoTwo', scope.row, scope.$index) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const logisticsMessage = h('el-link', { domProps: { innerHTML: '查看换货物流' }, on: { click: () => { this.showDialog('物流信息-换货', '640px', '2', scope.row) } }, attrs: { type: 'primary', size: 'mini' }})
    //       const confirmReceipt = h('el-link', { domProps: { innerHTML: '确认收货' }, on: { click: () => { this.onConfirmReceipt(scope.row) } }, attrs: { type: 'primary', size: 'mini' }})

    //       const isMyself = !!(scope.row.createdUserName === userInfo.reallyName || userInfo.id === 1)
    //       // console.log(parArray)
    //       // console.log(scope.row.createdUserName, userInfo.reallyName, isMyself, xgshwldh, xgshwldh.length > 0)
    //       const vNodeArr = []
    //       if (scope.row.afterSaleStepCode == 1) { // 审核中
    //         vNodeArr.push(seeDetails) // 查看
    //         if (scope.row.canDoApprove == 1) {
    //           vNodeArr.push(afterSaleShenhe) // 审核
    //         }
    //         vNodeArr.push(shenheStep) // 进度
    //         if (isMyself) {
    //           vNodeArr.push(cancelService) // 撤回售后 提交人权限
    //         }
    //       } else if (scope.row.afterSaleStepCode == 2) { // 待寄回
    //         vNodeArr.push(seeDetails) // 查看
    //         if (isMyself) {
    //           vNodeArr.push(modifyOrderNoOneTui) // 退货单号
    //           vNodeArr.push(cancelService) // 撤回售后 提交人权限
    //         }
    //       } else if (scope.row.afterSaleStepCode == 3) { // 退货中
    //         vNodeArr.push(seeDetails) // 查看
    //         vNodeArr.push(progress) // 查看退货物流
    //         if (isMyself) {
    //           vNodeArr.push(modifyOrderNoOne) // 修改退货单号
    //           vNodeArr.push(cancelService) // 撤回售后 提交人权限
    //         }
    //         if (main_confirmReceipt_wuliu.length > 0) {
    //           vNodeArr.push(confirmReceipt) // 确认收货 物流部权限
    //         }
    //       } else if (scope.row.afterSaleStepCode == 4) { // 待换货
    //         vNodeArr.push(seeDetails) // 查看
    //         if (isMyself) {
    //           vNodeArr.push(cancelService) // 撤回售后 提交人权限
    //         }
    //         if (order_huanhuojichu.length > 0) {
    //           vNodeArr.push(modifyOrderNoTwoHuan) // 换货寄出 物流部权限
    //         }
    //       } else if (scope.row.afterSaleStepCode == 5) { // 换货中
    //         vNodeArr.push(seeDetails) // 查看
    //         if (after_xghhdh.length > 0) {
    //           vNodeArr.push(modifyOrderNoTwo) // 修改换货单号 物流部权限
    //         }
    //         vNodeArr.push(logisticsMessage) // 查看换货物流
    //         if (isMyself) {
    //           vNodeArr.push(cancelService) // 撤回售后 提交人权限
    //           vNodeArr.push(confirmReceipt) // 确认收货
    //         }
    //       } else if (scope.row.afterSaleStepCode == 6 || scope.row.afterSaleStepCode == 7 || scope.row.afterSaleStepCode == 8) { // 售后关闭 + 商家拒绝售后 + 售后完成
    //         vNodeArr.push(seeDetails) // 查看
    //       } else { // 无售后
    //         vNodeArr.push(seeDetails) // 查看
    //       }
    //       return (
    //         h('div', {
    //           // class: { child: true, more: false },
    //           attrs: { id: 'foo', name: 'child' }
    //         }, vNodeArr))
    //       /*
    //       (
    //         <div>
    //           <el-link class={order_after_pageList.length == 1 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.toOtherPages('afterSaleDetails', scope.row, 'Details') }} >查看</el-link>
    //           <el-link class={plsh.length === 1 && scope.row.createdUserName !== userInfo.reallyName ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('审核', '640px', 'afterSaleShenhe', scope.row, scope.$index) }}>
    //             <span class={scope.row.afterSaleStepCode == 1 ? '' : 'hide-content'}>审核</span>
    //           </el-link>
    //           <el-link class={scope.row.afterSaleStepCode != 1 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('审核流程', '640px', 'shenheStep', scope.row, scope.$index) }}><span class={scope.row.afterSaleStepCode != 8 ? '' : 'hide-content'}>进度</span></el-link>
    //           <el-link class={chsh.length === 1 && scope.row.createdUserName === userInfo.reallyName && scope.row.afterSaleStepCode != 8 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.cancelAfterSales('撤回售后', '640px', 'cancelService', scope.row.afterNo) }}>撤回售后</el-link>
    //           <el-link class={scope.row.afterSaleStepCode == 3 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('物流信息-退货', '640px', 'progress', scope.row, scope.$index) }}>查看退货物流</el-link>
    //           <el-link class={scope.row.createdUserName === userInfo.reallyName && scope.row.afterSaleStepCode == 3 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('修改退货单号', '500px', 'modifyOrderNoOne', scope.row, scope.$index) }}>修改退货单号</el-link>
    //           <el-link class={xgshdd.length === 1 && scope.row.afterSaleStepCode == 5 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('修改换货单号', '500px', 'modifyOrderNoTwo', scope.row, scope.$index) }}>修改换货单号</el-link>
    //           <el-link class={xgshwldh.length === 1 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('退货单号', '500px', 'modifyOrderNoOne', scope.row, scope.$index) }}>
    //             <span class={scope.row.createdUserName === userInfo.reallyName && scope.row.afterSaleStepCode == 2 ? '' : 'hide-content'}>退货单号</span>
    //           </el-link>
    //           <el-link class={xgshwldh.length === 1 && scope.row.afterSaleStepCode == 4 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('换货寄出', '500px', 'modifyOrderNoTwo', scope.row, scope.$index) }}>换货寄出</el-link>
    //           <el-link class={xgshwldh.length === 1 && scope.row.afterSaleStepCode == 5 ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.showDialog('物流信息-换货', '640px', '2', scope.row) }}>查看换货物流</el-link>
    //           <el-link class={(xgshdd.length === 1 && scope.row.afterSaleStepCode == 3) || (scope.row.createdUserName === userInfo.reallyName && scope.row.afterSaleStepCode == 5) ? '' : 'hide-content'} type='primary' size='mini' onClick={() => { this.onConfirmReceipt(scope.row) }}>确认收货</el-link>
    //         </div>
    //       )
    //        */
    //     }
    //   }
    //   this.columns.push(operation)
    //   // console.log(this.columns[this.columns.length - 1])
    // },
    // 确认收货
    onConfirmReceipt (row) {
      this.$confirm('是否确认收货？请确认商品已签收?', '确认收货', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const params = { id: row.id }
        this.$api.afterConfirmReceipt(params).then((res) => {
          // this.fetchData('operation')
          if (res.code === 0) {
            this.$message({
              type: 'success',
              message: '操作成功!'
            })
          } else {
            this.$message({
              type: 'warning',
              message: res.message
            })
          }
          this.fetchData('search', true)
        }).catch((err) => {
          console.log(err)
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消收货'
        })
      })
    },
    // // 页面跳转
    // toOtherPages (name, parameter, type) {
    //   let query = { id: parameter, type }
    //   if (type === 'Details') { query = { afterNo: parameter.afterNo, orderId: parameter.orderId, id: parameter.id } }
    //   if (type === 'category') { query = { category: parameter, type } }
    //   this.$router.push({ name, query })
    // },
    // 撤回售后
    cancelAfterSales (dialogObj) {
      this.dialog.title = dialogObj.title
      this.dialog.type = dialogObj.type
      // if (!batch) { this.dialog.row = data }
      this.dialog.visible = true
      this.dialog.width = dialogObj.width
      this.afterNoId = dialogObj.afterNo
      this.cancellationReason = ''
    },
    handlerCloseOrderSubmit () {
      const params = {
        afterNo: this.afterNoId,
        closeReason: this.cancellationReason
      }
      this.$api.afterDoCancel(params).then((res) => {
        this.dialog.visible = false
        this.fetchData()
      }).catch((err) => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped lang="scss">
.page{
  text-align: center;
  margin: 10px auto;
}
/deep/ .el-link{margin: 0 5px;}
/deep/ .el-button {border: none;}
/deep/.el-table th > .cell, /deep/.el-table td{ text-align: unset;}
/deep/.hide-content{display: none !important}
.content{
  h3 {
    .el-button {
      font-size: 16px;
      padding: 0;
      color: #4168E7;
      float: right;
      width: 120px;
      height: 36px;
      line-height: 36px;
      border: 1px solid #4168E7;
      border-radius: 4px;
    }
  }
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  /deep/ .el-form-item {
    width: 100%;
    max-width: 350px;
    min-width: 300px;
    .el-form-item__content {
      .el-select, .el-date-editor {
        width: 100%;
      }
    }
  }
}
.cancellation-reason{
  margin-bottom: 20px;
  h3{
    text-align: left;
    margin-bottom: 20px;
    font-size: 16px;
    color: #333333;
  }
  .cancellation-left{
    float: left;
    width: 60px;
    color: #333333;
    text-align: left;
    padding-right: 10px;
  }
  .cancellation-right{
    float: left;
    width: calc( 100% - 100px);
    //width: 100%;
  }
}

.dialog-but{
  text-align: right;
}
/deep/.el-table th > .cell{
  text-align: unset;
}
.dialogBtnright{
    display: flex;
    justify-content: space-between ;
}
.dialogBtnright_right{
   display: flex;
    justify-content: right !important;

}
 .setPay_payment_btn_quxiao{
    width: 120px;
    height: 36px;
    border: 1px solid #D9D9D9;
    opacity: 1;
    border-radius: 4px;
    line-height: 0;
  }
  .setPay_payment_btn_queren{
    width: 120px;
    height: 36px;
    background: #4168E7;
    opacity: 1;
    border-radius: 4px;
    line-height: 0;
    border: 0;
  }
/deep/.el-table__row td .cell span, /deep/.el-table__row td .cell div p{
  display: block;
  overflow : hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;      /* 可以显示的行数，超出部分用...表示*/
  -webkit-box-orient: vertical;
}
</style>
